/**
 * OSAmI: Open Source Ambient Intelligence
 * Copyright (C) 2010 Bull S.A.S.
 * Contact: osami-general@osami-commons.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 *
 * --------------------------------------------------------------------------
 * $Id: UriAnalyzer.java 231 2010-08-26 16:08:55Z guillaume.sauthier $
 * --------------------------------------------------------------------------
 */

package org.osami.gateway.display.internal.uri;

import java.util.Map;

/**
 * A {@code UriAnalyzer} is a component that analyze a given path and extracts values from it.
 * It can be very useful to declares REST like resources.
 *
 * For example, an analyzer build from "/users/{id}/list/{type}" will return the following values:
 * <ul>
 *  <li>{@code /users/132-154afd2-54f/list/car}<br />
 *  <ul>
 *   <li>id -> 132-154afd2-54f</li>
 *   <li>type -> car</li>
 *  </ul>
 *  </li>
 * </ul>
 *
 * @author Guillaume Sauthier
 */
public interface UriAnalyzer {

    /**
     * Analyze the given path
     * @param path
     * @return
     */
    Map<String, String> analyze(String path);

    /**
     * @return the recognized pattern.
     */
    String getPattern();
}
